import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

const randomLetterPlugin = require("./plugins/randomLetterPlugin");

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), randomLetterPlugin()],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  server: {
    host: true,
    port: 1995,
    hmr: true,
  },
  devServe: {
    headers: {
      "Access-Control-Allow-Origin": "*",
    },
  },
});
